package com.zl.cms.model;


/**
 * User: zl email:c3tc3tc3t@126.com Date: 14-3-6 Time: 下午1:19
 */
// @Entity
// @Table(name="t_keyword")
public class Keyword implements Comparable<Keyword> {
  private int id;
  /**
   * 关键字名称
   */
  private String name;
  /**
   * 关键字引用次数
   */
  private int times;
  /**
   * 关键字全拼 eg: 关键字 新闻 全拼 xinwen 全拼简称 xw
   */
  private String nameFullPy;
  /**
   * 关键字全拼开头字母
   */
  private String nameShortPy;

  @Override
  public int compareTo(Keyword o) {
    return this.getTimes() > o.getTimes() ? -1 : (this.getTimes() == o.getTimes() ? 0 : 1);
  }

  public Keyword() {

  }

  public Keyword(int id, String name) {
    this.id = id;
    this.name = name;
  }

  public Keyword(String name, int times) {
    this.name = name;
    this.times = times;
  }

  // @Id
  // @GeneratedValue(strategy = GenerationType.IDENTITY)
  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public int getTimes() {
    return times;
  }

  public void setTimes(int times) {
    this.times = times;
  }

  // @Column(name = "name_full_py")
  public String getNameFullPy() {
    return nameFullPy;
  }

  public void setNameFullPy(String nameFullPy) {
    this.nameFullPy = nameFullPy;
  }

  // @Column(name = "name_short_py")
  public String getNameShortPy() {
    return nameShortPy;
  }

  public void setNameShortPy(String nameShortPy) {
    this.nameShortPy = nameShortPy;
  }

  @Override
  public String toString() {
    return "Keyword{" + "id=" + id + ", name='" + name + '\'' + ", times=" + times
        + ", nameFullPy='" + nameFullPy + '\'' + ", nameShortPy='" + nameShortPy + '\'' + '}';
  }
}
